package com.yamaha.bikedesalon.util;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.testflightapp.lib.TestFlight;

public class LogUtil {
	public static void d(final String tag, final String message) {
		Log.d(tag, message);
		TestFlight.log("TAG : " + tag + ", DEBUG: " + message);
	}

	public static void e(final String tag, final String message, final Throwable e) {
		Log.e(tag, message, e);
		TestFlight.log("TAG : " + tag + ", Error : " + message + " [" + e.getMessage() + "]");
	}

	public static void e(final Context context, final String tag, final String message) {
		Log.e(tag, message);
		TestFlight.log("TAG : " + tag + ", Error : " + message);
		Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
	}

	public static void e(final Context context, final String tag, final String message, final Throwable e) {
		Log.e(tag, message, e);
		TestFlight.log("TAG : " + tag + ", Error : " + message + " [" + e.getMessage() + "]");
		Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
	}
	public static void w(final String tag, final String message) {
		Log.w(tag, message);
		TestFlight.log("TAG : " + tag + ", Warning : " + message);
	}

	public static void i(final String tag, final String message) {
		Log.i(tag, message);
		TestFlight.log("TAG : " + tag + ", INFO : " + message);
	}

	public static void v(final String tag, final String message) {
		Log.v(tag, message);
		TestFlight.log("TAG : " + tag + ", VERBOSE : " + message);
	}
}
